Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@commitlint/read
Advanced tools
@commitlint/read is an npm package that provides functionality to read and parse commit messages. It is typically used in conjunction with commitlint to enforce commit message conventions.
Read commit messages from a file
This feature allows you to read commit messages from a specified range of commits. In this example, it reads the commit message from the last commit.
const read = require('@commitlint/read');
read({from: 'HEAD~1', to: 'HEAD'}).then((messages) => {
console.log(messages);
});
Read commit messages from stdin
This feature allows you to read commit messages from the standard input. This is useful for integrating with other tools that provide commit messages via stdin.
const read = require('@commitlint/read');
process.stdin.on('data', (data) => {
read({edit: true}).then((messages) => {
console.log(messages);
});
});
conventional-changelog is a package that reads commit messages and generates changelogs based on conventional commit messages. It provides more extensive functionality for generating changelogs and release notes compared to @commitlint/read.
git-raw-commits is a package that reads raw commit messages from a git repository. It is similar to @commitlint/read in that it focuses on reading commit messages, but it provides more low-level access to the raw commit data.
Read commit messages from a specified range or last edit
npm install --save @commitlint/read
const read = require('@commitlint/read').default;
// Read last edited commit message
read({edit: true}).then((messages) => console.log(messages));
// => ['I did something\n\n']
// Read from the third to second commit message from HEAD
read({from: 'HEAD~2', to: 'HEAD~1'}).then((messages) => console.log(messages));
// => ['Initial commit\n\n']
Consult docs/api for comprehensive documentation.
FAQs
Read commit messages from a specified range or last edit
The npm package @commitlint/read receives a total of 1,942,906 weekly downloads. As such, @commitlint/read popularity was classified as popular.
We found that @commitlint/read demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.